<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<th:block layout:fragment="pagination">
<script  th:inline="javascript">
    function goToPage(page) {
        var form = $([[${formSelecter}]])[0];
        $([['[name='+${pageParmName}+']']]).val(page);
        form.submit();
    }
</script>
<ul class="pagination">
    <li th:onclick="'javascript:goToPage(1)'" class="page-item" th:classappend="${page.number+1 == 1}?disabled:''"><span class="page-link">‹</span></li>
    <li th:onclick="'javascript:goToPage('+${i}+')'" th:each="i:${#numbers.sequence(page.number+1-6,page.number+6)}" class="page-item" th:classappend="${page.number+1 == i}?'active':''" th:if="${i>0 and i<=page.totalPages}"><span class="page-link" th:text="${i}"></span></li>
    <li th:onclick="'javascript:goToPage('+${page.totalPages}+')'" class="page-item" th:classappend="${page.number+1 == page.totalPages}?disabled:''"><a class="page-link" th:href="'javascript:void(0)'" rel="next">›</a></li>
</ul>
</th:block>
